<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script type="text/javascript" src="jquery.min.js"></script>
</head>
<body>
	
	<input type="button" value="通过AJAX获取多个Category对象" id="sender">  
	<div id="messageDiv"></div>
	
	<script type="text/javascript">
		$('#sender').click(function(){
			var url="getManyCategory";
			
			$.post(
					url,
					function(data){
						 console.log(data);
						 var categorys = $.parseJSON(data);
						 console.log(category.length);
						 
						 for(i in categorys){
							 var old = $("#messageDiv").html();
							 var category = categorys[i];
							 $("#messageDiv").html(old + "<br>" + category.id + "-----" + category.name);
						 }
					}
			);
		});
	</script>
</body>
</html>